import request from '@/config/axios'

export interface ProductDataTypeVO{
  id:number
  dataType: number //数据类型：1，精友
  vin: string
  amVehicleId: string
  amVehicleName: string
  amSeriesName: string
  amMainBrandName: string
  amBrandName: string
  vehCateNames: string
  vehCateOneNames: string
  vehCateTwoNames: string
  amYear: string
  bodyType: string
  importFlag: string
  amSeriesId: string
  amGroupId: string
  amGroupName: string
  vinSource: string
  chassisModel: string
  queryTimes: number
  status: string
  remark: string
}

// ERP 产品品牌 API
export const ProductDataTypeApi = {
  getProductDataTypePage: async (params: any) => {
    return await request.get({ url: `/erp/product-data-type/page`, params })
  },

  // 查询ERP 产品品牌详情
  getProductDataType: async (id: number) => {
    return await request.get({ url: `/erp/product-data-type/get?id=` + id })
  },

  // 新增ERP 产品品牌
  createProductDataType: async (data: ProductDataTypeVO) => {
    return await request.post({ url: `/erp/product-data-type/create`, data })
  },

  // 修改ERP 产品品牌
  updateProductDataType: async (data: ProductDataTypeVO) => {
    return await request.put({ url: `/erp/product-data-type/update`, data })
  },
  // 修改ERP 产品品牌
  syncProductData: async (data: ProductDataTypeVO) => {
    return await request.put({ url: `/erp/product-data-type/sync`, data })
  },

  // 删除ERP 产品品牌
  deleteProductDataType: async (id: number) => {
    return await request.delete({ url: `/erp/product-data-type/delete?id=` + id })
  },

  // 导出ERP 产品品牌 Excel
  exportProductDataType: async (params) => {
    return await request.download({ url: `/erp/product-data-type/export-excel`, params })
  },
}
